﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows.Forms;

namespace Milan.Forms
{
	public partial class FormAbout : Form
	{
		public FormAbout()
		{
			InitializeComponent();
		}

		private void FormAbout_Load(object sender, EventArgs e)
		{
			this.Text = "About " + Milan.Settings.ProductName;
			labelCompanyName.Text = Milan.Settings.CompanyName;
			labelProductName.Text = Milan.Settings.ProductName;
			labelVersion.Text = Milan.Settings.ProductVersion.ToString();
			labelBuildDate.Text = Milan.Diagnostics.Pe.RetrieveLinkerTimestamp(Assembly.GetEntryAssembly()).ToLocalTime().ToString("F");
			labelCopyright.Text = ((AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(Assembly.GetEntryAssembly(), typeof(AssemblyCopyrightAttribute), false)).Copyright;
			linkLabelSupportUrl.Text = ((Milan.Reflection.AssemblySupportUrlAttribute)Attribute.GetCustomAttribute(Assembly.GetEntryAssembly(), typeof(Milan.Reflection.AssemblySupportUrlAttribute), false)).SupportUrl;
		}

		private void buttonClose_Click(object sender, EventArgs e)
		{
			Close();
		}

		private void linkLabelSupportUrl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
		{
			System.Diagnostics.Process.Start(linkLabelSupportUrl.Text);
		}
	}
}
